<?if ($this->status):?>
<div id="email-congrat" style="margin-left: 280px; margin-bottom: 25px; color: #8E0313; font-size: 14px; font-weight: bold;">Your message was sended!</div>

<?endif;?>
<script>
  var contactussubject;
  var contactusemail;
  var contactusmessage;

$(function(){

//    $('.contactus input[type=submit] ').attr('disabled','disabled');
    $('.contactus input[type=text]').focus(function(){

        contactusemail=$('.contactus input[type=email]').val();
    });
    $('.contactus textarea').focus(function(){
         contactussubject=$('.contactus input[type=text]').val();
    });
   



   $('.contactus input[type=submit] ').click(function(){
        contactusmessage=$('.contactus textarea').val();
        if((contactussubject)&&(contactusmessage))
        {
        if ((contactusemail.length>4)&&(contactussubject.length>2)&&(contactusmessage.length>2))
        {
             $('form').attr('onsubmit','return true');
        }
        }
        else{
            $('#error').css('display','block');
            $('form').attr('onsubmit','return false');
        }

   });
});
</script>
<div id="error" style="display: none;font-weight: bold;color: red;margin-left: 262px;">Please, fill all fileds correctly</div>
<form  method="post" action="" >
<table class="contactus">
<tr>
<td><label for="email-guest">Your email:</label></td>
<td><input class="text" type="email" placeholder="Email" value="" name="email-guest"/></td>
</tr>
<tr>
    <td><label for="email-subject">Subject:</label></td>
    <td><input class="text" type="text" placeholder="Subject" value="" name="email-subject"/></td>
</tr>
<tr>
    <td colspan="2"><label for="email-message">Your message:</label></td>
</tr>
<tr>
    <td colspan="2"><textarea name="email-message" id="email-message" rows="3" cols="25" placeholder="Message"></textarea></td>
</tr>
<tr>
    <td colspan="2"><center><input type="submit" value="Send mail" ></center></td>
</tr>

</table>

</form>